// BioSignalDevice.h
#ifndef BIOSIGNALDEVICE_H
#define BIOSIGNALDEVICE_H

#include <QObject>
#include <QVector>

class BioSignalDevice : public QObject {
    Q_OBJECT
public:
    explicit BioSignalDevice(QObject *parent = nullptr) : QObject(parent),
        m_isConnected(false), m_isAcquiring(false) {}

    virtual ~BioSignalDevice() {}

    // 设备连接相关
    virtual bool connect() = 0;
    virtual bool disconnect() = 0;

    // 数据采集相关
    virtual bool startAcquisition() = 0;
    virtual bool stopAcquisition() = 0;

    // 获取设备信息
    virtual QString getDeviceInfo() const = 0;

    // 状态查询
    bool isConnected() const { return m_isConnected; }
    bool isAcquiring() const { return m_isAcquiring; }

signals:
    // 设备状态变化信号
    void connectionStatusChanged(bool connected);
    void acquisitionStatusChanged(bool acquiring);

    // 数据就绪信号
    void dataReady(const QVector<double>& data, int channelIndex);

    // 新增：多通道数据就绪信号
    void allChannelsDataReady(const QVector<double>& allChannelsData);

    // 错误信号
    void errorOccurred(const QString& errorMessage);

protected:
    bool m_isConnected;
    bool m_isAcquiring;
};

#endif // BIOSIGNALDEVICE_H
